package com.alexgaoyh.MutiModule.Dubbo.RWSeperate.provider.read.manager.sysman.sysmanUserRoleRel;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.MutiModule.common.myPage.MyPageView;
import com.MutiModule.common.myPage.util.MyPageViewUtilss;
import com.MutiModule.common.vo.mybatis.pagination.Page;
import com.alexgaoyh.MutiModule.Dubbo.RWSeperate.api.manager.sysman.sysmanUserRoleRel.read.ISysmanUserRoleRelReadService;
import com.alexgaoyh.MutiModule.Dubbo.RWSeperate.persist.manager.sysman.sysmanUserRoleRel.SysmanUserRoleRelExample;
import com.alexgaoyh.MutiModule.Dubbo.RWSeperate.persist.manager.sysman.sysmanUserRoleRel.SysmanUserRoleRelKey;
import com.alexgaoyh.MutiModule.Dubbo.RWSeperate.persist.manager.sysman.sysmanUserRoleRel.SysmanUserRoleRelMapper;

@Service(value = "sysmanUserRoleRelService")
public class SysmanUserRoleRelServiceImpl implements ISysmanUserRoleRelReadService{
	
	@Resource(name = "sysmanUserRoleRelMapper")
	private SysmanUserRoleRelMapper mapper;

	@Override
	public int countByExample(SysmanUserRoleRelExample example) {
		return mapper.countByExample(example);
	}

	@Override
	public List<SysmanUserRoleRelKey> selectByExample(SysmanUserRoleRelExample example) {
		return mapper.selectByExample(example);
	}

	@Override
	public MyPageView<SysmanUserRoleRelKey> generateMyPageViewVO(SysmanUserRoleRelExample exampleWithOutPage, Page page) {
		
		int _totalCount = mapper.countByExample(exampleWithOutPage);
		
		exampleWithOutPage.setPage(page);
		
		List<SysmanUserRoleRelKey> _list = mapper.selectByExample(exampleWithOutPage);
		
		MyPageView<SysmanUserRoleRelKey> pageView = new MyPageViewUtilss<SysmanUserRoleRelKey>().generaterMyPageView(page.getLength(), page.getPageNo(), _totalCount, _list);
		
		return pageView;
	}

}
